import 'package:equatable/equatable.dart';
import 'package:mobile_app.core/core/domain/entities/primary_color.dart';
import 'package:mobile_app.core/core/domain/entities/theme_mode.dart';

class AppearanceSettings extends Equatable {
  const AppearanceSettings({
    required this.themeMode,
    required this.primaryColorChangePermitted,
    required this.lightThemeSelectedPrimaryColor,
    required this.lightThemeEffectivePrimaryColor,
    required this.darkThemeSelectedPrimaryColor,
    required this.darkThemeEffectivePrimaryColor,
  });

  final ThemeMode themeMode;
  final bool primaryColorChangePermitted;
  final LightThemePrimaryColor lightThemeSelectedPrimaryColor;
  final LightThemePrimaryColor lightThemeEffectivePrimaryColor;
  final DarkThemePrimaryColor darkThemeSelectedPrimaryColor;
  final DarkThemePrimaryColor darkThemeEffectivePrimaryColor;

  @override
  List<Object?> get props {
    return [
      themeMode,
      primaryColorChangePermitted,
      lightThemeSelectedPrimaryColor,
      lightThemeEffectivePrimaryColor,
      darkThemeSelectedPrimaryColor,
      darkThemeEffectivePrimaryColor,
    ];
  }

  AppearanceSettings copyWith({
    ThemeMode Function()? themeMode,
    bool Function()? primaryColorChangePermitted,
    LightThemePrimaryColor Function()? lightThemeSelectedPrimaryColor,
    LightThemePrimaryColor Function()? lightThemeEffectivePrimaryColor,
    DarkThemePrimaryColor Function()? darkThemeSelectedPrimaryColor,
    DarkThemePrimaryColor Function()? darkThemeEffectivePrimaryColor,
  }) {
    return AppearanceSettings(
      themeMode: themeMode == null ? this.themeMode : themeMode(),
      primaryColorChangePermitted: primaryColorChangePermitted == null
          ? this.primaryColorChangePermitted
          : primaryColorChangePermitted(),
      lightThemeSelectedPrimaryColor: lightThemeSelectedPrimaryColor == null
          ? this.lightThemeSelectedPrimaryColor
          : lightThemeSelectedPrimaryColor(),
      lightThemeEffectivePrimaryColor: lightThemeEffectivePrimaryColor == null
          ? this.lightThemeEffectivePrimaryColor
          : lightThemeEffectivePrimaryColor(),
      darkThemeSelectedPrimaryColor: darkThemeSelectedPrimaryColor == null
          ? this.darkThemeSelectedPrimaryColor
          : darkThemeSelectedPrimaryColor(),
      darkThemeEffectivePrimaryColor: darkThemeEffectivePrimaryColor == null
          ? this.darkThemeEffectivePrimaryColor
          : darkThemeEffectivePrimaryColor(),
    );
  }
}
